//
//  DiscoverNewWIFIView.m
//  Router
//
//  Created by teki on 15/11/4.
//  Copyright © 2015年 dc. All rights reserved.
//

#import "DiscoverNewWIFIView.h"

@interface DiscoverNewWIFIView ()


@property (weak, nonatomic) IBOutlet UILabel *promtLabel;

@property (weak, nonatomic) IBOutlet UIButton *settingButton;

@property (nonatomic, copy) SettingButtonBlock block;
@end

@implementation DiscoverNewWIFIView



- (void)awakeFromNib
{
    self.backgroundColor = [UIColor colorWithHexString:@"#4c9244"];
    self.settingButton.layer.cornerRadius = 5.0f;
    self.settingButton.layer.masksToBounds = YES;
    self.settingButton.layer.borderColor = [UIColor whiteColor].CGColor;
    self.settingButton.layer.borderWidth = 1.0f;
}


+ (DiscoverNewWIFIView *)loadViewFromNib
{
    NSArray *array = [[NSBundle mainBundle] loadNibNamed:@"DiscoverNewWIFIView" owner:self options:nil];
    return array[0];
}



- (void)show
{
    self.hidden = NO;
}


- (void)hidden
{
    self.hidden = YES;
}

- (IBAction)settingButtonPressed:(id)sender {
    if (self.block)
    {
        self.block();
    }
}


- (void)setShowText:(NSString *)showText
{
    _showText = showText;
    self.promtLabel.text = showText;
}


- (void)setIsShowSettingButton:(BOOL)isShowSettingButton
{
    _isShowSettingButton = isShowSettingButton;
    if (isShowSettingButton)
    {
        self.settingButton.hidden = NO;
    }
    else
    {
        self.settingButton.hidden = YES;
    }

}


#pragma mark -
#pragma mark   setters and getters
- (void)setSettingButtonBlock:(SettingButtonBlock)block
{
    _block = block;
}



@end
